package com.lhy.mymall.mapper;

import com.lhy.mymall.pojo.Cart;
import com.lhy.mymall.vo.CartVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: 卢辉宇
 * @date: 2022/12/18 12:39
 * @description:
 */
@Mapper
public interface CartMapper {

    Cart selectByUserIdAndProductId(@Param("userId") Integer userId, @Param("productId") Integer productId);

    int insert(Cart cart);

    int updateById(Cart cart);

    List<CartVO> selectList(Integer userId);

    int deleteById(Integer cartId);

    int selectOrNot(@Param("userId") Integer userId, @Param("productId") Integer productId, @Param("selected") Integer selected);

    int selectAllOrNot(Integer userId, Integer selected);

}
